<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>

	<button class="btn up">上移</button>
	<button class="btn down">下移</button>
	<hr>
	
	<table id="myTable" border="1">
		<tr>
			<td><input type="checkbox"></td>
			<td>item1</td>
			<td>item2</td>
			<td>item3</td>
			<td>item4</td>
			<td>item5</td>
		</tr>
		<tr>
			<td><input type="checkbox"></td>
			<td>item11</td>
			<td>item2</td>
			<td>item3</td>
			<td>item4</td>
			<td>item5</td>
		</tr>
		<tr>
			<td><input type="checkbox"></td>
			<td>item12</td>
			<td>item2</td>
			<td>item3</td>
			<td>item4</td>
			<td>item5</td>
		</tr>
		<tr>
			<td><input type="checkbox"></td>
			<td>item13</td>
			<td>item2</td>
			<td>item3</td>
			<td>item4</td>
			<td>item5</td>
		</tr>
		<tr>
			<td><input type="checkbox"></td>
			<td>item14</td>
			<td>item2</td>
			<td>item3</td>
			<td>item4</td>
			<td>item5</td>
		</tr>
	</table>

	<hr>

	<div class="div1">
		<div class="div2">
			<div class="div3">
				<div class="div4">123</div>
			</div>
		</div>
	</div>

	<script src="../lib/jquery-1.12.1.min.js"></script>
	<script>
		!function() {
			"use strict";

			var $btn = $('.btn');

			$btn.on('click', function() {
				var $this = $(this),
					$target = $('#myTable input[type="checkbox"]:checked');

				if ($target.length != 1) {
					return;
				}

				if ($this.hasClass('down')) {
					$target.parents('tr').next('tr').after($target.parents('tr'));
				} else {
					$target.parents('tr').prev('tr').before($target.parents('tr'));
				}
			});

		}();
	</script>
</body>
</html>